package com.sdonkey.score.model;

import org.apache.commons.lang.StringUtils;

/**
 * Created by Administrator on 2018\12\19 0019.
 */
public class AdPlaceBeanCommon {

    /**
     *
     */
    private static final long serialVersionUID = -633136549338590823L;

    public String id;

    public String adId;

    public String adName;

    public String advertiserCode;

    public String startTime;

    public String endTime;

    public  String adType;

    public String terminalinfo;

    public String consumeAmount;
    //广告图片路径
    public String adHomepage;
    //广告预览路径(pad)
    public String padVersionUrl;
    //广告载体
    public String terminalType;
    //广告预览路径(pc)
    public String pcVersionUrl;
    //广告预览路径(mobile)
    public String mobileVersionUrl;
    //广告预览路径(tv)
    public String tvVersionUrl;
    //广告投放剩下的钱那
    public Double deliveryRemainingAmount;
    //是否可投放
    public String adStatus;
    //投放状态
    public String status;

    //是否被投诉
    public String putStatus;

    //当前广告余额
    public String advertiserBalance;

    //单价（渠道）
    public String channelPrice;
    public String getChannelPrice() {
        return channelPrice;
    }

    public void setChannelPrice(String channelPrice) {
        this.channelPrice = channelPrice;
    }

    public String getPutStatus() {
        return putStatus;
    }

    public void setPutStatus(String putStatus) {
        this.putStatus = putStatus;
    }

    public String getAdvertiserBalance() {
        return advertiserBalance;
    }

    public void setAdvertiserBalance(String advertiserBalance) {
        this.advertiserBalance = advertiserBalance;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getAdId() {
        return adId;
    }

    public void setAdId(String adId) {
        this.adId = adId;
    }

    public String getConsumeAmount() {
        return consumeAmount;
    }

    public void setConsumeAmount(String consumeAmount) {
        this.consumeAmount = consumeAmount;
    }

    public String getAdName() {
        return adName;
    }

    public void setAdName(String adName) {
        this.adName = adName;
    }

    public String getAdType() {
        return adType;
    }

    public void setAdType(String adType) {
        this.adType = adType;
    }

    public Double getDeliveryRemainingAmount() {
        return deliveryRemainingAmount;
    }

    public void setDeliveryRemainingAmount(Double deliveryRemainingAmount) {
        this.deliveryRemainingAmount = deliveryRemainingAmount;
    }

    public String getAdStatus() {
        return adStatus;
    }

    public void setAdStatus(String adStatus) {
        this.adStatus = adStatus;
    }

    public String getTerminalinfo() {
        return terminalinfo;
    }

    public void setTerminalinfo(String terminalinfo) {
        this.terminalinfo = terminalinfo;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getAdvertiserCode() {
        return advertiserCode;
    }

    public void setAdvertiserCode(String advertiserCode) {
        this.advertiserCode = advertiserCode;
    }

    public String getPadVersionUrl() {
        return padVersionUrl;
    }

    public void setPadVersionUrl(String padVersionUrl) {
        this.padVersionUrl = padVersionUrl;
    }

    public String getAdHomepage() {
        return adHomepage;
    }

    public void setAdHomepage(String adHomepage) {
        this.adHomepage = adHomepage;
    }

    public String getTerminalType() {
        return terminalType;
    }

    public void setTerminalType(String terminalType) {
        this.terminalType = terminalType;
    }

    public String getPcVersionUrl() {
        return pcVersionUrl;
    }

    public void setPcVersionUrl(String pcVersionUrl) {
        this.pcVersionUrl = pcVersionUrl;
    }

    public String getMobileVersionUrl() {
        return mobileVersionUrl;
    }

    public void setMobileVersionUrl(String mobileVersionUrl) {
        this.mobileVersionUrl = mobileVersionUrl;
    }

    public String getTvVersionUrl() {
        return tvVersionUrl;
    }

    public void setTvVersionUrl(String tvVersionUrl) {
        this.tvVersionUrl = tvVersionUrl;
    }

    public String terminalTypeShow(){
        String terminalType= "";
        if(StringUtils.isNotBlank(this.terminalinfo)){
            String[] keys = this.terminalinfo.split("\\|");
            int length = keys.length;
            if(StringUtils.isNotBlank(keys[0])){
                terminalType += "手机";
            }

            if(length > 1 && StringUtils.isNotBlank(keys[1] )){
                terminalType += " PC";
            }

            if(length > 2 && StringUtils.isNotBlank(keys[2] )){
                terminalType += " PAD";
            }

            if(length > 3 && StringUtils.isNotBlank(keys[3] )){
                terminalType += " TV";
            }
        }
        return terminalType;
    }

    public String  statusShow(){
        String statusShow = "";
        if("-1".equals(this.status)){
            statusShow="审核未通过";
        }else if("0".equals(this.status)){
            statusShow="审核中";
        }else if("1".equals(this.status)){
            statusShow="审核通过";
        }else if("2".equals(this.status)){
            statusShow="投放中";
        }else if("3".equals(this.status)){
            statusShow="暂停投放";
        }else if("4".equals(this.status)){
            statusShow="投放结束";
        }
        return statusShow;
    }

    public String  adTypeShow(){
        String adTypeShow = "";
        if("video".equals(this.adType)){
            adTypeShow="视频";
        } else if("picture".equals(this.adType)){
            adTypeShow="图片";

        }
        return adTypeShow;
    }
    @Override
    public String toString() {
        return "FinishPlacementAdBean [id=" + id + ", adId=" + adId + ", adName=" + adName + ", advertiserCode="
                + advertiserCode + ", startTime=" + startTime + ", endTime=" + endTime + ", adType=" + adType
                + ", terminalinfo=" + terminalinfo + ", consumeAmount=" + consumeAmount + ", status=" + status
                + ", putStatus=" + putStatus + "]";
    }
}
